﻿using System;

namespace Mono.Cecil.Cil
{
	// Token: 0x02000139 RID: 313
	public struct InstructionOffset
	{
		// Token: 0x17000309 RID: 777
		// (get) Token: 0x06000BC6 RID: 3014 RVA: 0x00034E48 File Offset: 0x00033048
		public int Offset
		{
			get
			{
				bool flag = this.instruction != null;
				int value;
				if (flag)
				{
					value = this.instruction.Offset;
				}
				else
				{
					bool flag2 = this.offset != null;
					if (!flag2)
					{
						throw new NotSupportedException();
					}
					value = this.offset.Value;
				}
				return value;
			}
		}

		// Token: 0x1700030A RID: 778
		// (get) Token: 0x06000BC7 RID: 3015 RVA: 0x00034E98 File Offset: 0x00033098
		public bool IsEndOfMethod
		{
			get
			{
				return this.instruction == null && this.offset == null;
			}
		}

		// Token: 0x1700030B RID: 779
		// (get) Token: 0x06000BC8 RID: 3016 RVA: 0x000062F2 File Offset: 0x000044F2
		internal bool IsResolved
		{
			get
			{
				return this.instruction != null || this.offset == null;
			}
		}

		// Token: 0x1700030C RID: 780
		// (get) Token: 0x06000BC9 RID: 3017 RVA: 0x0000630D File Offset: 0x0000450D
		internal Instruction ResolvedInstruction
		{
			get
			{
				return this.instruction;
			}
		}

		// Token: 0x06000BCA RID: 3018 RVA: 0x00034EC4 File Offset: 0x000330C4
		public InstructionOffset(Instruction instruction)
		{
			bool flag = instruction == null;
			if (flag)
			{
				throw new ArgumentNullException("instruction");
			}
			this.instruction = instruction;
			this.offset = null;
		}

		// Token: 0x06000BCB RID: 3019 RVA: 0x00006315 File Offset: 0x00004515
		public InstructionOffset(int offset)
		{
			this.instruction = null;
			this.offset = new int?(offset);
		}

		// Token: 0x04000741 RID: 1857
		private readonly Instruction instruction;

		// Token: 0x04000742 RID: 1858
		private readonly int? offset;
	}
}
